<template>
  <el-config-provider :locale="$i18n.messages[$i18n.locale]">
    <!--框架内显示-->
    <component :is="skinComponent" v-if="$route.meta.inFrame"></component>
    <!--不在框架中显示-->
    <router-view v-else />
  </el-config-provider>
</template>
<script>
import { computed, ref, watchEffect } from 'vue'

export default {
  setup() {
    const skinComponent = ref('')
    const skin = computed(() => mkh.store.state.app.profile.skin)

    watchEffect(() => {
      skinComponent.value = `m-skin-${skin.value.code.toLowerCase()}`
      document.body.className = `${skinComponent.value} theme-${skin.value.theme}`
    })

    return {
      skinComponent,
    }
  },
}
</script>
